package com.marchsoft.musicalstore.entity;

import org.springframework.data.annotation.Id;

import javax.persistence.Column;
import javax.persistence.Transient;

/**
 * 订单实体类
 * 用于返回所有订单
 */
public class Orders {
    @Id
    private int id;
//    @Column(name = "buy_type")
    private int buyType;//购买类型
    @Transient
    private String name;//商品名称
//    @Column(name = "user_id")
    private int userId;//购买人员
//    @Column(name = "product_id")
    private int productId;//商品id
//    @Column(name = "is_out")
    private int isOut;//是否下架0未下架1下架
//    @Column(name = "price_count")
    private int priceCount;//价格总数
//    @Column(name = "product_num")
    private int productNum;//商品总数
//    @Column(name = "order_pic")
    private String orderPic;

    public Orders(){}

    public Orders(int id, int buyType, String name, int userId, int productId, int isOut, int priceCount, int productNum, String orderPic) {
        this.id = id;
        this.buyType = buyType;
        this.name = name;
        this.userId = userId;
        this.productId = productId;
        this.isOut = isOut;
        this.priceCount = priceCount;
        this.productNum = productNum;
        this.orderPic = orderPic;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getBuyType() {
        return buyType;
    }

    public void setBuyType(int buyType) {
        this.buyType = buyType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public int getIsOut() {
        return isOut;
    }

    public void setIsOut(int isOut) {
        this.isOut = isOut;
    }

    public int getPriceCount() {
        return priceCount;
    }

    public void setPriceCount(int priceCount) {
        this.priceCount = priceCount;
    }

    public int getProductNum() {
        return productNum;
    }

    public void setProductNum(int productNum) {
        this.productNum = productNum;
    }

    public String getOrderPic() {
        return orderPic;
    }

    public void setOrderPic(String orderPic) {
        this.orderPic = orderPic;
    }

    @Override
    public String toString() {
        return "Orders{" +
                "id=" + id +
                ", buyType=" + buyType +
                ", name='" + name + '\'' +
                ", userId=" + userId +
                ", productId=" + productId +
                ", isOut=" + isOut +
                ", priceCount=" + priceCount +
                ", productNum=" + productNum +
                ", orderPic='" + orderPic + '\'' +
                '}';
    }
}
